﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Web.API.IBLL;
using Web.API.Model;

namespace Web.API.UI.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class UserController : ControllerBase
    {
        public UserController(UserIBLL bll) 
        {
            Bll = bll;
        }
        public UserIBLL Bll { get; }
        [HttpPost("AddStart")]
        public Task<int> AddStart(UserStart start)
        {
            return Bll.AddStart(start);
        }
        [HttpPost("AddUser")]
        public Task<int> AddUser(UserModel user)
        {
           return Bll.AddUser(user);
        }
        [HttpGet("Fantian")]
        public UserModel Fantian(int id)
        {
            return Bll.Fantian(id);
        }
        [HttpGet("GetUser")]
        public dynamic GetUser(int index, int size)
        {
            return Bll.GetUser(index, size);
        }
        [HttpPut("UpdUser")]
        public Task<int> UpdUser(UserModel user)
        {
            return Bll.UpdUser(user);
        }
        [HttpGet("Xiala")]
        public List<UserStart> Xiala()
        {
            return Bll.Xiala();
        }
    }
}
